<{include file="Public/top.html"}>
<style>
    .album img{width: 80px;}
</style>
</head>
<body>
<div id="warpper">
    <div class="content">
        <div class="location">订单管理</div>

        <{include file= "Order/nav.html"}>

        <div class="filedSet" style="padding-bottom: 0;">
            <div class="search">
                <form action="" method="post" class="ui-form reportForm" id="searchForm">
                    <input name="m" type="hidden" value="<{$module}>">
                    <input name="c" type="hidden" value="<{$controller}>">
                    <input name="a" type="hidden" value="<{$action}>">

                    <input name="p" id="page" type="hidden" value="<{$page|default:1}>">
                    <input name="limit" id="limit" type="hidden" value="<{$limit|default:10}>">
                    <input name="ofield" id="ofield" type="hidden" value="<{$ofield}>">
                    <input name="otype"  id="otype"  type="hidden" value="<{$otype}>">

                    <div class="ui-form-item inline-block">
                        <label class="ui-label">房间</label>
                        <select name="userType" class="ui-select" style="width: 160px;">
                               <{html_options options=$roomKv selected=$selectedRoom}>
                        </select>
                    </div>
                    <div class="ui-form-item inline-block">
                        <label class="ui-label">订单状态</label>
                        <select name="auditStatus" class="ui-select" style="width: 160px;">
                            <{html_options options=$statusKv selected=$selectedAuditType}>
                        </select>
                    </div>

                    <div class="ui-form-item inline-block">
                        <button type="submit" class="ui-button" onclick="LayerShow();">查询</button>
                    </div>
                </form>
            </div>
        </div>
        <!--表格内容-->
        <div class="mainGrid">
            <table class="ui-table ui-body">
                <thead>
                <tr>
                    <th class="pct10">房间</th>
                    <th class="pct10">联系人</th>
                    <th class="pct5">入住时间</th>
                    <th class="pct5">选定日期</th>
                    <th class="pct5">备注</th>
                    <th class="pct5">总金额</th>
                    <th class="pct5">订单状态</th>
                    <th class="pct5">下单时间</th>
                    <th class="pct10 last-col">操作</th>
                </tr>
                </thead>
                <tbody>
                <{foreach from=$list item=item}>
                <tr>
                    <td>(<{$item.rid}>)<{$roomKv[$item.rid]}></td>
                    <td><{$item.uid}> <{$item.linkman}><br /><{$item.phone}></td>

                    <td><{$item.checkInTime}></td>
                    <td><{str_replace(',','<br />',$item.selectedDate)}></td>
                    <td><{$item.mem}></td>
                    <td><{$item.totalMoney}></td>
                    <td><{$statusKv[$item.status]}></td>
                    <td><{$item.addTime|date_format:"%Y-%m-%d<br />%T"}></td>
                    <td class="ta_l">
                        <div class="handler">
                            <{if $item.status eq $hasPaid}>
                                <a href="javascript:void(0)" onclick="refund(<{$item.oid}>)" >退款</a><span class="sep">|</span>
                                <a href="javascript:void(0)" onclick="cancel(<{$item.oid}>)" >取消订单</a><span class="sep">|</span>
                            <{/if}>
                            <a href="javascript:void(0)" onclick="edit(<{$item.oid}>)">修改订单</a>
                        </div>
                    </td>
                </tr>
                <{/foreach}>
                </tbody>
            </table>
        </div>
        <!--描述：分页-->
        <div class="pagination">
            <{include file="Public/page.html"}>
        </div>

    </div>
</div>


<div class="form-box border0 " id="refund" style="display:none">
    <form  class="ui-form" method="post" id="addManagerForm">
        <input type="hidden"  name="rid" id="rid" />

        <div class="ui-form-item">
            <label class="ui-label">房间名称：</label>
            <input type="text" class="ui-text" id="roomName" readonly/>
        </div>
        <div class="ui-form-item">
            <label class="ui-label">订单总金额：</label>
            <input type="text" class="ui-text" id="roomName" readonly/>
        </div>
        <div class="ui-form-item">
            <label class="ui-label">日期范围：</label>
            <input id="startDate" name="startDate"  readonly class="ui-text" type="text" required/>
            至
            <input id="endDate" name="endDate"   class="ui-text" type="text" required/>
        </div>
        <div class="ui-form-item">
            <label class="ui-label">房间状态：</label>
            <select class="ui-select" name="status">
                <{html_options options=$roomStatus }>
            </select>
        </div>

        <div class="integral_btn-group">
            <input type="submit" value="提交" class="ui-button"/>
        </div>

    </form>
</div>


<{include file="Public/foot.html" }>
<script>
    function refund(oid){

        layer.open({
            type: 2,
            area: ['700px', '600px'],
            fixed: false, //不固定
            maxmin: true,
            content: "<{u(refundView)}>&oid="+oid
        });


    }

</script>
</body>
